package com.xishu.entity.shop;

import com.xishu.annotation.valid.UniqueName;
import com.xishu.entity.AbstractEntity;
import com.xishu.entity.oplog.OpName;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;

@Entity(name = "food_table_type_config")
@Table(indexes = {@Index(columnList = "shopId")})
public class FoodTableTypeConfig extends AbstractEntity implements OpName {
    private static final long serialVersionUID = -1147522692196720942L;

    @Transient
    private String opName;

    @ApiModelProperty(value = "餐桌类型名")
    private String name;

    @ApiModelProperty(value = "归属哪一个餐厅公司")
    private Long companyId;

    @ApiModelProperty(value = "归属哪一个分店")
    @UniqueName(union = true)
    private Long shopId;

    @ApiModelProperty(value = "餐桌代码，A,B,C这样的代码")
    @UniqueName(union = true)
    private String code;

    @ApiModelProperty(value = "最大人数")
    private Integer maxPerson;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getMaxPerson() {
        return maxPerson;
    }

    public void setMaxPerson(Integer maxPerson) {
        this.maxPerson = maxPerson;
    }

    public String getName() {
        return name;
    }

    @Override
    public String opType() {
        return "餐桌配置";
    }

    @Override
    public String[] fieldName() {
        return new String[]{"shopId", "name"};
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    @Override
    public String getOpName() {
        return opName;
    }

    @Override
    public void setOpName(String opName) {
        this.opName = opName;
    }
}
